
<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="layout" content="main" />
    <title>Application</title>



  </head>
  <body>
      <div class="body">
    <h1>Application</h1>
   <!-- <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>-->

     <g:hasErrors bean="${employeeInstance}">
            <div class="errors">
                <g:renderErrors bean="${employeeInstance}" as="list" />  </div>
           </g:hasErrors>

     <!--hmmm-->

     <!--choose course -->

      <form action="sendCourse" method="post">
                                    <label for="course">Course:</label>
                            <g:select id="courseId" optionKey="id" from="${Course.list()}" name="courseId" value="${courseInstance?.id}" ></g:select>
                             <input  type="hidden" id="employeeId" name="employeeId" value="${employeeInstance.employeeId}">
                        <input value="Search for course" type="submit">
                      </form>

     <g:if test="${params.courseId}">
    

<!--display info and then save some changes employee: ok null parts-->
                <g:form action="save" method="post" >
                <div class="dialog">
              
                            <!--name-->
                           <h2 style="margin-left:5px;">${fieldValue(bean:employeeInstance, field:'firstName')} ${fieldValue(bean:employeeInstance, field:'lastName')}</h2>

                             <table style="border:none;table-layout: fixed">
                      <tbody>
                         <!--email-->
                          <tr>
                            <td valign="top" class="name"><b>${Inter.printOut('Email:',session.language)}</b> ${fieldValue(bean:employeeInstance, field:'email')}</td>
                          </tr>
                           <!--lukasid not exists only if employee not for external-->

                         <!--befattning exists employee title-->
                           <tr>
                            <td valign="top" class="name"><b>${Inter.printOut('Title',session.language)}:</b> ${fieldValue(bean:employeeInstance, field:'title')}</td>

                          </tr>
                          <!-- instutition och avdelning  hiredby?? or does have to say-->
                             <tr>
                          <td valign="top" class="name"><b>${Inter.printOut('Hired By',session.language)}:</b> ${employeeInstance?.hiredBy?.name}
                      </td>
                            <!--faculty exists -->
                             <tr><td valign="top" class="name"><b>Faculty:</b> ${fieldValue(bean:employeeInstance, field:'faculty')}</td></tr>
                            
                             <!--fakturaadress square not eexist not in employee  take for description for project-->
                   

                              <!--Kundnr/motpartskonto (internt liu) not exists-->
                             <tr class="prop">
                                <td valign="top" class="name">
                                  <!--  <label for="percentageWork">-->
                                    Kundnr/motpartskonto
                                  <!--  </label>-->
                                </td>
                               <!-- <td valign="top" class="value ${hasErrors(bean:employeeInstance,field:'percentageWork','errors')}">
                                    <input type="text" id="percentageWork" size="5" maxlength="5" name="percentageWork" title="${Inter.printOut('employee_percentageWork_hover',session.language)}" value="${fieldValue(bean:employeeInstance,field:'percentageWork')}" />%
                                </td>-->
                            </tr>
                              <!--Jag har talat med ekonomiskt ansvarig som accepterat att betala kurskostnaden : square-->
                        
                          <tr>
                             <td><input type="checkbox" name="fields_10_" value="true"></td>
                           <td>Jag har talat med ekonomiskt ansvarig som accepterat att betala kurskostnaden</td>
                      
                           </tr>
                     
                             <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="course">Time:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:courseInstance,field:'schedule','errors')}">
                                    <g:select optionKey="id" from="${Schedule.list()}" name="course.id" value="${courseInstance?.id}" ></g:select>
                                </td>

                            </tr>

                      </tbody>
                  </table>
                      
                   <input type="hidden" id="mode" name="mode" value="${session.mode}"/>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Apply" /></span> <!--if new employee else annat-->
                </div>
            </g:form>
</g:if>

                <!--hmm-->
      </div>
  </body>
</html>

